package com.dys.testrelect02;

/**
 * @className: com.dys.testrelect02.Student
 * @description: com.dys.testrelect02
 * @author: pine cone
 * @version: v1.0.0
 * @createTime: 2024/08/27 下午8:42
 */
@MyAnnotation(value = "student")
public class Student extends Person implements MyInterface {
    // 属性
    private int sno;
    double height;
    protected double weight;
    public double score;

    // 方法
    @MyAnnotation(value = "showStuInfo")
    public String showInfo() {
        return "我是一名三好学生";
    }

    public String showInfo(int a, int b) {
        return "重载方法===>我是一名三好学生";
    }

    private void work(int a) {
        System.out.println("我以后会找工作，成为一名码农");
    }

    void happy() {
        System.out.println("开心每一天......");
    }

    protected int getSno() {
        return sno;
    }

    // 构造器
    public Student() {
        System.out.println("空参构造器......");
    }

    public Student(double height, double weight) {
        this.height = height;
        this.weight = weight;
    }

    private Student(int sno) {
        this.sno = sno;
    }

    Student(double height) {
        this.height = height;
    }

    protected Student(int sno, double height) {
        this.sno = sno;
        this.height = height;
    }

    @Override
    @MyAnnotation(value = "helloMethod")
    public void myMethod() throws RuntimeException {
        System.out.println("重写了MyInterface里面的抽象方法......");
    }

    @Override
    public String toString() {
        return "Student{" +
                "sno=" + sno +
                ", height=" + height +
                ", weight=" + weight +
                ", score=" + score +
                '}';
    }
}
